import { RouterName } from '../name'
import { Role } from '@/constants/role'

import { mergeMeta } from '../merge-meta'

export const userRoutes = mergeMeta(
  [
    {
      path: 'users',
      name: RouterName.UserCenter,
      redirect: { name: RouterName.UserStudentList },
      meta: {
        hideInMenu: false,
        menuTitle: 'navigation.users.title',
        isLink: false,
        icon: 'i-fluent-folder-people-24-filled'
      },
      children: [
        {
          path: 'profile',
          name: RouterName.User,
          meta: {
            role: Role.All,
            hideInMenu: true,
            menuTitle: 'navigation.users.profile'
          },
          component: () => import('@/pages/UserPage/ProfilePage/index.vue')
        },
        {
          path: 'students',
          name: RouterName.UserStudentList,
          meta: {
            menuTitle: 'navigation.users.students',
            icon: 'i-fluent-people-audience-20-filled'
          },
          component: () => import('@/pages/UserPage/StudentList/index.vue')
        },
        {
          path: 'managers',
          name: RouterName.UserManagerList,
          meta: {
            menuTitle: 'navigation.users.managers',
            icon: 'i-fluent-people-queue-24-filled'
          },
          component: () => import('@/pages/UserPage/ManagerList/index.vue')
        }
      ]
    }
  ],
  {
    requireAuth: true,
    role: Role.Teacher | Role.Admin
  }
)
